package observer;

import com.google.common.eventbus.Subscribe;

import java.util.Observable;
import java.util.Observer;

/**
 * Created by thiswhyme on 2019/03/24.
 */
public class Teacher {

    private String name;

    public Teacher(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Subscribe
    public void update(Object arg) {
        Question question = (Question) arg;
        System.out.println(this.name + "老师收到了" + question.getAskerName() + "提出的\""
                + question.getContent() + "\"问题。");
    }
}
